import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_base/widgets/appbar/common_app_bar.dart';

class NavigationViewNew extends StatelessWidget {
  const NavigationViewNew({super.key, this.title, this.color, this.actions, this.showLeft = false});

  final String? title;
  final Color? color;
  final List<Widget>? actions;
  final bool showLeft;

  @override
  Widget build(BuildContext context) {
    return Column(mainAxisSize: MainAxisSize.min, children: [
      Container(
        width: 46.w,
        height: 6.w,
        margin: EdgeInsets.symmetric(vertical: 12.w),
        decoration: BoxDecoration(
          color: color ?? Colors.black.withOpacity(0.5),
          borderRadius: BorderRadius.circular(3.w),
        ),
      ),
      Visibility(
        visible: (title ?? '').isNotEmpty || (actions ?? []).isNotEmpty,
        child: CommonAppBar(
          title: title ?? '',
          actions: actions,
          showLeft: showLeft,
        ),
      ),
    ]);
  }
}
